package org.item.customer.controller;


import com.baomidou.mybatisplus.core.metadata.IPage;
import org.item.common.bean.CustomerContacts;
import org.item.common.bean.CustomerInteractions;
import org.item.common.bean.Customers;
import org.item.common.service.ICustomerInteractionsService;
import org.item.common.util.ResultData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("customerinteractions")
public class CustomerInteractionsController  {

    @Autowired
    ICustomerInteractionsService customerInteractionsService;

    @PostMapping("/")
    public ResultData insert(@RequestBody CustomerInteractions customerInteractions){
        CustomerInteractions data= customerInteractionsService.insert(customerInteractions);
        return ResultData.success(data);
    }

    @PutMapping("/")
    public ResultData update(@RequestBody CustomerInteractions customerInteractions){
        CustomerInteractions data= customerInteractionsService.update(customerInteractions);
        return ResultData.success(data);
    }

    @GetMapping("/page")
    public ResultData getListByPage(IPage page, @RequestBody CustomerInteractions customerInteractions){
        IPage data=customerInteractionsService.getListByPage(page, customerInteractions);
        return ResultData.success(data);
    }

}
